package com.register;

import java.util.Scanner;
import java.util.regex.Pattern;

public class Email extends Register{
    Scanner sc = new Scanner(System.in);
    @Override

    public void input() {
        System.out.println("输入邮箱");
        setStr(sc.next());
        setStatus(Pattern.matches("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$",getStr()));
        if (!this.isStatus()){
            System.out.println("邮箱输入错误");
            this.input();
        }
        System.out.println("注册成功");
    }
}
